//
//  ZeroTableViewCell.m
//  B_WatchHome
//
//  Created by dllo on 15/12/24.
//  Copyright © 2015年 DHF. All rights reserved.
//

#import "ZeroTableViewCell.h"
#import <UIImageView+WebCache.h>
#import <Masonry.h>

@implementation ZeroTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews
{
    self.leftImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.leftImageView];
    [self.leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(15);
        make.left.mas_equalTo(10);
        make.size.mas_equalTo(CGSizeMake(100, 100));
        
    }];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.mas_equalTo(15);
        make.left.mas_equalTo(self.leftImageView.mas_right).offset(15);
        make.right.mas_equalTo(-10);
        self.titleLabel.numberOfLines = 0;
    }];
 
    
}

- (void)setModel:(SevendayModel *)model
{
    if (_model != model) {
        _model = model;
    }
    self.titleLabel.text = self.model.title;
    NSURL *url = [NSURL URLWithString:self.model.imglink];
    [self.leftImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
